//
//  CLMineModifyPwdViewController.swift
//  CLEasyBBQ
//
//  Created by simon zhao on 2017/4/22.
//  Copyright © 2017年 simon zhao. All rights reserved.
//

import UIKit

class CLMineModifyPwdViewController: CLBaseNavViewController,UITableViewDelegate,UITableViewDataSource {
    
    
    let reuStr = "modifyCell"
    let titleArr = ["原始密码","新密码","确认新密码"]
    let tipArr = ["请输入原密码","请设置6-12位新密码","请设置6-12位新密码"]

    override func viewDidLoad() {
        super.viewDidLoad()
        self.rightBtn.setTitle("保存", for: .normal)
        self.rightBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
        self.rightBtn.frame = CGRect(x:0,y:0,width:40,height:30)
        self.view.backgroundColor = UIColor.white
        // Do any additional setup after loading the view.
        
        let mehouseTablview = UITableView.init(frame: self.view.frame)
        mehouseTablview.delegate = self
        mehouseTablview.dataSource = self
        mehouseTablview.register(UINib.init(nibName: "CLMineMoPwdTableViewCell", bundle: nil), forCellReuseIdentifier: reuStr)
        self.view.addSubview(mehouseTablview)
        
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}

//tableview代理方法
extension CLMineModifyPwdViewController {
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        
        return 3
    }
    
    
    @objc(tableView:cellForRowAtIndexPath:) func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell : CLMineMoPwdTableViewCell = tableView.dequeueReusableCell(withIdentifier: reuStr, for: indexPath) as! CLMineMoPwdTableViewCell
        
        cell.titlelable.text = titleArr[indexPath.row]
        cell.inputField.placeholder = tipArr[indexPath.row]
        
        return cell
    }
}

